home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / Colors.st < prev    next >
Text File  |  2002-01-15  |  2KB  |  50 lines

  1. "------------------------------------------------------------------"
  2. " Colors Class implements control of Amiga Color registers         "
  3. " Chances are that Glyph is the wrong parent class for this class. "
  4. "------------------------------------------------------------------"
  5.  
  6. Class Colors :Glyph ! private parentObj !
  7. [
  8.    dispose
  9.       <primitive 184 0 private>.
  10.       ^ nil
  11. |
  12.    loadColors: howMany from: colorMapFileName
  13.       <primitive 184 2 parentObj howMany colorMapFileName>
  14. |
  15.    getColor: srcType from: srcObject which: n  
  16.  
  17.       " srcType 1 is WindowObject, all else is colorMapObject: "
  18.  
  19.       ^ <primitive 184 3 srcType srcObject n>
  20. |
  21.    setColorReg: n red: r green: g blue: b
  22.       <primitive 184 4 parentObj n r g b>
  23. |
  24.    setMapValue: srcType from: srcObject num: n red: r green: g blue: b
  25.  
  26.       " srcType 1 is WindowObject, all else is colorMapObject: "
  27.  
  28.       <primitive 184 5 srcType srcObject n r g b>
  29. |
  30.    copyMap: sourceObject to: destObject sourceType: srcType
  31.  
  32.       " srcType 1 is WindowObject  (dest is ColorMap)
  33.       * all else is colorMapObject (dest is WindowObject): 
  34.       "
  35.  
  36.       <primitive 184 6 sourceObject destObject srcType>
  37. |
  38.    saveColorsTo: colorMapFileName
  39.       <primitive 184 7 parentObj colorMapFileName>
  40.    makeColorMap: numColors
  41.       private <- <primitive 184 1 private numColors>.
  42.       ^ self
  43. |
  44.    new: windowObject
  45.       parentObj  <- windowObject.    "cmap <- Colors new: windowObj"
  46.       private    <- nil.             " makeColorMap will initialize this"
  47.       ^ self
  48. ]
  49.